-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PLATFORM-1195]: rfc8414 compliance #185
Conversation
acc5086
to
f08e24d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job :). Just a little thing
url = metadata_url(base_url) | ||
%HTTPoison.Response{status_code: status_code, body: meta_body} = Telepoison.get!(url, accept: "application/json") | ||
|
||
true = status_code in 200..299 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would handle it in a more graceful way since the error code might be a bit confusing from the user perspective. I think we might custom panic this and the Telepoison.get!
to give a more relevant information to the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover i think it might be better to call this def fetch!(...
being that this function might panic. Otherwise you can return {:ok, __MODULE__.t()} | {:error, atom() | String.t()}
and gracefully handle panics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to fetch!
and added an exception. I think panicking in this situation makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't retrieve_token
on the hot path? 🤔
Anyways, nice!
good point, I assumed it would get cached in redis, I'm not sure if the extra request is worth it |
I didn't think about it but it totally is if you don't configure redis. Maybe if redis isn't configured we could use an ets cache by default? |
Either ETS or an |
c81a948
to
34f3c2f
Compare
9bbcf25
to
929c4e4
Compare
34584ad
to
dce464c
Compare
dce464c
to
201079f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/PLATFORM-1195
This allows auth0_ex to be used with okta as well as auth0 🙂